<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/jquery.min.js"></script>
	</head>
	<body>
		<div>
			<input type="checkbox" name="hobby" id="hobby" />乒乓球
			<input type="checkbox" name="hobby" id="hobby" />象棋
			<input type="checkbox" name="hobby" id="hobby" />荡秋千
		</div>
		<div>
			<button id="selectAll">全选</button>
			<button id="unSelectAll">全取消</button>
		</div>
	</body>
	<script>
		$("#selectAll").click(function(){
			$("[id=hobby]").prop("checked",true);
		})
		
		$("#unSelectAll").click(function(){
			$("[id=hobby]").attr("checked",false);
		})
		
	</script>
</html>
